﻿@model IEnumerable<HotelMgr.Models.Notice>
@using HotelMgr.Models
@using Telerik.Web.Mvc.UI
@{
    ViewBag.Title = "Index";
}
<h2 style="text-align: center;font-size: 20px;font-weight: bolder;">公告管理</h2>
@(Html.Telerik().Grid(Model)
.Name("NoticeGrid")
.DataKeys(key=>key.Add(k=>k.NoticeID))
.ToolBar(c=>c.Insert().ButtonType(GridButtonType.Image))
.DataBinding(b=>b.Server()
    .Select("Select","NoticeManager")
    .Insert("Insert","NoticeManager")
    .Update("Save","NoticeManager")
    .Delete("Delete","NoticeManager")
)
.Columns(r=>
             {
                 r.Bound(i => i.NoticeID).Title("公告编号");
                 r.Bound(i => i.AddDate);
                 r.Bound(i => i.NoticeContent);
                 r.Bound(i => i.InvalidDate);
                 r.Bound(i => i.NoticeTitle);
                 r.Command(c =>
                               {
                                   c.Edit().ButtonType(GridButtonType.Image);
                                   c.Delete().ButtonType(GridButtonType.Image);
                               }).Title("操作");
             })
             .Editable(e=>e.Mode(GridEditMode.InLine))
             .Pageable()
             .Scrollable(s=>s.Enabled(true))
           .Footer(true))

